@extends('home.jicheng')
@section('content')
<div class="ebody">

    <div class="cart_box1" align="center">
      <div style="margin:20px auto;">
      
        <div class="cart_tx1"><strong>我的订单&nbsp;&nbsp;&nbsp;@if(session('info'))
        <span style="color:red;" id="info">{{session('info')}}</span>
        @endif</strong></div>

  @foreach($data as $row)
  <div class="cart_box1">
    <div class="lista">
        
         <table cellpadding="0" cellspacing="0">
         <thead>
                    <tr class="tx">
                        <td class="cellone" colspan="2" align="center" style="text-align:center">商品名</td>
                        <td width="87" >单价</td>
                        <td width="118">数量</td>
                        <td width="107">小计</td>
                        <td width="71">收货人</td>
                        <td width="71">订单状态</td>
                        <td style="width:150px">操作</td>
                        
                    </tr>
         </thead>
         <tbody>
                @foreach($detail[$row -> id] as $line)
                <tr class="cartli1">
                    <td width="102" valign="middle">
                      <img style="width:100px;height:100px;" src="{{asset($line -> gid -> gpic)}}" alt="">
                    </td>
                    <td width="363"  class="txtx">{{$line -> gid -> gname}}</td>
                    <td>￥{{$line -> price}}元</td>
                    <td><big>{{$line -> count}}</big></span></td>
                    <td align="center">{{($line -> price) * ($line -> count)}}</td>
                    <td><small>{{$row -> rec}}</small></td>
                    <td>@if($row -> status == 0 )未发货@elseif($row -> status == 1)已发货,未签收@else 已签收 @endif</td>
                    <td>@if($row -> status == 1)<a href="{{asset('home/order/shouhuo')}}/{{$row -> id}}">确认收货</a>@elseif($row -> status == 0)催货@else <a href="{{ url('home/goods/comment')}}/{{$row -> id}}/{{$line -> gid -> gid}}">评价商品</a>@endif</td>
                </tr>
                @endforeach
            </tbody>
    <tfoot>
        <tr>
          <td height="55" valign="middle"  class="cellone2" > </td>
          <td height="55" valign="middle"  class="cellone2" ></td>
         <td height="55" colspan="5" valign="middle"  class="cellone" >
           
            <p class="t2">商品总金额：</p>
          </td>
          <td style="font-size:20px;color:red"><strong>￥{{ $detail[$row -> id] -> num}}</strong></td>
        </tr>
    </tfoot>
    </table>
    
</div>
</div>
@endforeach
</div>
</div>
</div>
    <script type="text/javascript">
    
        window.onload = function()
        {
            $('#info').fadeOut(1000);  
        }

    </script>
@endsection('content')